3.90 \(\int \frac{\csc ^4(e+f x)}{(a+b \tan ^2(e+f x))^3} \, dx\)

Optimal. Leaf size=154 \[ -\frac{5 \sqrt{b} (3 a-7 b) \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )}{8 a^{9/2} f}-\frac{b (7 a-11 b) \tan (e+f x)}{8 a^4 f \left (a+b \tan ^2(e+f x)\right )}-\frac{b (a-b) \tan (e+f x)}{4 a^3 f \left (a+b \tan ^2(e+f x)\right )^2}-\frac{(a-3 b) \cot (e+f x)}{a^4 f}-\frac{\cot ^3(e+f x)}{3 a^3 f} \]

[Out]

(-5*(3*a - 7*b)*Sqrt[b]*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a]])/(8*a^(9/2)*f) - ((a - 3*b)*Cot[e + f*x])/(a^4*
f) - Cot[e + f*x]^3/(3*a^3*f) - ((a - b)*b*Tan[e + f*x])/(4*a^3*f*(a + b*Tan[e + f*x]^2)^2) - ((7*a - 11*b)*b*
Tan[e + f*x])/(8*a^4*f*(a + b*Tan[e + f*x]^2))

________________________________________________________________________________________

Rubi [A]  time = 0.205548, antiderivative size = 154, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.217, Rules used = {3663, 456, 1259, 1261, 205} \[ -\frac{5 \sqrt{b} (3 a-7 b) \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )}{8 a^{9/2} f}-\frac{b (7 a-11 b) \tan (e+f x)}{8 a^4 f \left (a+b \tan ^2(e+f x)\right )}-\frac{b (a-b) \tan (e+f x)}{4 a^3 f \left (a+b \tan ^2(e+f x)\right )^2}-\frac{(a-3 b) \cot (e+f x)}{a^4 f}-\frac{\cot ^3(e+f x)}{3 a^3 f} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]^4/(a + b*Tan[e + f*x]^2)^3,x]

[Out]

(-5*(3*a - 7*b)*Sqrt[b]*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a]])/(8*a^(9/2)*f) - ((a - 3*b)*Cot[e + f*x])/(a^4*
f) - Cot[e + f*x]^3/(3*a^3*f) - ((a - b)*b*Tan[e + f*x])/(4*a^3*f*(a + b*Tan[e + f*x]^2)^2) - ((7*a - 11*b)*b*
Tan[e + f*x])/(8*a^4*f*(a + b*Tan[e + f*x]^2))

Rule 3663

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff^(m + 1))/f, Subst[Int[(x^m*(a + b*(ff*x)^n)^p)/(c^2 + ff^2*x^2
)^(m/2 + 1), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2]

Rule 456

Int[(x_)^(m_)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[((-a)^(m/2 - 1)*(b*c - a*d)*
x*(a + b*x^2)^(p + 1))/(2*b^(m/2 + 1)*(p + 1)), x] + Dist[1/(2*b^(m/2 + 1)*(p + 1)), Int[x^m*(a + b*x^2)^(p +
1)*ExpandToSum[2*b*(p + 1)*Together[(b^(m/2)*(c + d*x^2) - (-a)^(m/2 - 1)*(b*c - a*d)*x^(-m + 2))/(a + b*x^2)]
 - ((-a)^(m/2 - 1)*(b*c - a*d))/x^m, x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] &
& ILtQ[m/2, 0] && (IntegerQ[p] || EqQ[m + 2*p + 1, 0])

Rule 1259

Int[(x_)^(m_)*((d_) + (e_.)*(x_)^2)^(q_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), x_Symbol] :> Simp[((-d)^(
m/2 - 1)*(c*d^2 - b*d*e + a*e^2)^p*x*(d + e*x^2)^(q + 1))/(2*e^(2*p + m/2)*(q + 1)), x] + Dist[(-d)^(m/2 - 1)/
(2*e^(2*p)*(q + 1)), Int[x^m*(d + e*x^2)^(q + 1)*ExpandToSum[Together[(1*(2*(-d)^(-(m/2) + 1)*e^(2*p)*(q + 1)*
(a + b*x^2 + c*x^4)^p - ((c*d^2 - b*d*e + a*e^2)^p/(e^(m/2)*x^m))*(d + e*(2*q + 3)*x^2)))/(d + e*x^2)], x], x]
, x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && IGtQ[p, 0] && ILtQ[q, -1] && ILtQ[m/2, 0]

Rule 1261

Int[((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^2)^(q_.)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), x_Symbol] :> In
t[ExpandIntegrand[(f*x)^m*(d + e*x^2)^q*(a + b*x^2 + c*x^4)^p, x], x] /; FreeQ[{a, b, c, d, e, f, m, q}, x] &&
 NeQ[b^2 - 4*a*c, 0] && IGtQ[p, 0] && IGtQ[q, -2]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{\csc ^4(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^3} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{1+x^2}{x^4 \left (a+b x^2\right )^3} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{(a-b) b \tan (e+f x)}{4 a^3 f \left (a+b \tan ^2(e+f x)\right )^2}-\frac{b \operatorname{Subst}\left (\int \frac{-\frac{4}{a b}-\frac{4 (a-b) x^2}{a^2 b}+\frac{3 (a-b) x^4}{a^3}}{x^4 \left (a+b x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{4 f}\\ &=-\frac{(a-b) b \tan (e+f x)}{4 a^3 f \left (a+b \tan ^2(e+f x)\right )^2}-\frac{(7 a-11 b) b \tan (e+f x)}{8 a^4 f \left (a+b \tan ^2(e+f x)\right )}-\frac{\operatorname{Subst}\left (\int \frac{-8 a b-8 (a-2 b) b x^2+\frac{(7 a-11 b) b^2 x^4}{a}}{x^4 \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{8 a^3 b f}\\ &=-\frac{(a-b) b \tan (e+f x)}{4 a^3 f \left (a+b \tan ^2(e+f x)\right )^2}-\frac{(7 a-11 b) b \tan (e+f x)}{8 a^4 f \left (a+b \tan ^2(e+f x)\right )}-\frac{\operatorname{Subst}\left (\int \left (-\frac{8 b}{x^4}-\frac{8 (a-3 b) b}{a x^2}+\frac{5 (3 a-7 b) b^2}{a \left (a+b x^2\right )}\right ) \, dx,x,\tan (e+f x)\right )}{8 a^3 b f}\\ &=-\frac{(a-3 b) \cot (e+f x)}{a^4 f}-\frac{\cot ^3(e+f x)}{3 a^3 f}-\frac{(a-b) b \tan (e+f x)}{4 a^3 f \left (a+b \tan ^2(e+f x)\right )^2}-\frac{(7 a-11 b) b \tan (e+f x)}{8 a^4 f \left (a+b \tan ^2(e+f x)\right )}-\frac{(5 (3 a-7 b) b) \operatorname{Subst}\left (\int \frac{1}{a+b x^2} \, dx,x,\tan (e+f x)\right )}{8 a^4 f}\\ &=-\frac{5 (3 a-7 b) \sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )}{8 a^{9/2} f}-\frac{(a-3 b) \cot (e+f x)}{a^4 f}-\frac{\cot ^3(e+f x)}{3 a^3 f}-\frac{(a-b) b \tan (e+f x)}{4 a^3 f \left (a+b \tan ^2(e+f x)\right )^2}-\frac{(7 a-11 b) b \tan (e+f x)}{8 a^4 f \left (a+b \tan ^2(e+f x)\right )}\\ \end{align*}

Mathematica [A]  time = 1.63158, size = 146, normalized size = 0.95 \[ \frac{\sqrt{a} \left (-\frac{3 b \sin (2 (e+f x)) \left (\left (9 a^2-20 a b+11 b^2\right ) \cos (2 (e+f x))+9 a^2-6 a b-11 b^2\right )}{((a-b) \cos (2 (e+f x))+a+b)^2}-8 \cot (e+f x) \left (a \csc ^2(e+f x)+2 a-9 b\right )\right )+15 \sqrt{b} (7 b-3 a) \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )}{24 a^{9/2} f} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]^4/(a + b*Tan[e + f*x]^2)^3,x]

[Out]

(15*Sqrt[b]*(-3*a + 7*b)*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a]] + Sqrt[a]*(-8*Cot[e + f*x]*(2*a - 9*b + a*Csc[
e + f*x]^2) - (3*b*(9*a^2 - 6*a*b - 11*b^2 + (9*a^2 - 20*a*b + 11*b^2)*Cos[2*(e + f*x)])*Sin[2*(e + f*x)])/(a
+ b + (a - b)*Cos[2*(e + f*x)])^2))/(24*a^(9/2)*f)

________________________________________________________________________________________

Maple [A]  time = 0.099, size = 235, normalized size = 1.5 \begin{align*} -{\frac{1}{3\,f{a}^{3} \left ( \tan \left ( fx+e \right ) \right ) ^{3}}}-{\frac{1}{f{a}^{3}\tan \left ( fx+e \right ) }}+3\,{\frac{b}{f{a}^{4}\tan \left ( fx+e \right ) }}-{\frac{7\,{b}^{2} \left ( \tan \left ( fx+e \right ) \right ) ^{3}}{8\,f{a}^{3} \left ( a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) ^{2}}}+{\frac{11\,{b}^{3} \left ( \tan \left ( fx+e \right ) \right ) ^{3}}{8\,f{a}^{4} \left ( a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) ^{2}}}-{\frac{9\,b\tan \left ( fx+e \right ) }{8\,f{a}^{2} \left ( a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) ^{2}}}+{\frac{13\,{b}^{2}\tan \left ( fx+e \right ) }{8\,f{a}^{3} \left ( a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) ^{2}}}-{\frac{15\,b}{8\,f{a}^{3}}\arctan \left ({b\tan \left ( fx+e \right ){\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}+{\frac{35\,{b}^{2}}{8\,f{a}^{4}}\arctan \left ({b\tan \left ( fx+e \right ){\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)^4/(a+b*tan(f*x+e)^2)^3,x)

[Out]

-1/3/f/a^3/tan(f*x+e)^3-1/f/a^3/tan(f*x+e)+3/f/a^4/tan(f*x+e)*b-7/8/f/a^3*b^2/(a+b*tan(f*x+e)^2)^2*tan(f*x+e)^
3+11/8/f/a^4*b^3/(a+b*tan(f*x+e)^2)^2*tan(f*x+e)^3-9/8/f/a^2*b/(a+b*tan(f*x+e)^2)^2*tan(f*x+e)+13/8/f/a^3*b^2/
(a+b*tan(f*x+e)^2)^2*tan(f*x+e)-15/8/f/a^3*b/(a*b)^(1/2)*arctan(b*tan(f*x+e)/(a*b)^(1/2))+35/8/f/a^4*b^2/(a*b)
^(1/2)*arctan(b*tan(f*x+e)/(a*b)^(1/2))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^4/(a+b*tan(f*x+e)^2)^3,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 2.55194, size = 1999, normalized size = 12.98 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^4/(a+b*tan(f*x+e)^2)^3,x, algorithm="fricas")

[Out]

[-1/96*(4*(16*a^3 - 131*a^2*b + 220*a*b^2 - 105*b^3)*cos(f*x + e)^7 - 4*(24*a^3 - 206*a^2*b + 485*a*b^2 - 315*
b^3)*cos(f*x + e)^5 - 20*(15*a^2*b - 62*a*b^2 + 63*b^3)*cos(f*x + e)^3 + 15*((3*a^3 - 13*a^2*b + 17*a*b^2 - 7*
b^3)*cos(f*x + e)^6 - (3*a^3 - 19*a^2*b + 37*a*b^2 - 21*b^3)*cos(f*x + e)^4 - 3*a*b^2 + 7*b^3 - (6*a^2*b - 23*
a*b^2 + 21*b^3)*cos(f*x + e)^2)*sqrt(-b/a)*log(((a^2 + 6*a*b + b^2)*cos(f*x + e)^4 - 2*(3*a*b + b^2)*cos(f*x +
 e)^2 - 4*((a^2 + a*b)*cos(f*x + e)^3 - a*b*cos(f*x + e))*sqrt(-b/a)*sin(f*x + e) + b^2)/((a^2 - 2*a*b + b^2)*
cos(f*x + e)^4 + 2*(a*b - b^2)*cos(f*x + e)^2 + b^2))*sin(f*x + e) - 60*(3*a*b^2 - 7*b^3)*cos(f*x + e))/(((a^6
 - 2*a^5*b + a^4*b^2)*f*cos(f*x + e)^6 - a^4*b^2*f - (a^6 - 4*a^5*b + 3*a^4*b^2)*f*cos(f*x + e)^4 - (2*a^5*b -
 3*a^4*b^2)*f*cos(f*x + e)^2)*sin(f*x + e)), -1/48*(2*(16*a^3 - 131*a^2*b + 220*a*b^2 - 105*b^3)*cos(f*x + e)^
7 - 2*(24*a^3 - 206*a^2*b + 485*a*b^2 - 315*b^3)*cos(f*x + e)^5 - 10*(15*a^2*b - 62*a*b^2 + 63*b^3)*cos(f*x +
e)^3 - 15*((3*a^3 - 13*a^2*b + 17*a*b^2 - 7*b^3)*cos(f*x + e)^6 - (3*a^3 - 19*a^2*b + 37*a*b^2 - 21*b^3)*cos(f
*x + e)^4 - 3*a*b^2 + 7*b^3 - (6*a^2*b - 23*a*b^2 + 21*b^3)*cos(f*x + e)^2)*sqrt(b/a)*arctan(1/2*((a + b)*cos(
f*x + e)^2 - b)*sqrt(b/a)/(b*cos(f*x + e)*sin(f*x + e)))*sin(f*x + e) - 30*(3*a*b^2 - 7*b^3)*cos(f*x + e))/(((
a^6 - 2*a^5*b + a^4*b^2)*f*cos(f*x + e)^6 - a^4*b^2*f - (a^6 - 4*a^5*b + 3*a^4*b^2)*f*cos(f*x + e)^4 - (2*a^5*
b - 3*a^4*b^2)*f*cos(f*x + e)^2)*sin(f*x + e))]

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)**4/(a+b*tan(f*x+e)**2)**3,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.624, size = 236, normalized size = 1.53 \begin{align*} -\frac{\frac{15 \,{\left (\pi \left \lfloor \frac{f x + e}{\pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (b\right ) + \arctan \left (\frac{b \tan \left (f x + e\right )}{\sqrt{a b}}\right )\right )}{\left (3 \, a b - 7 \, b^{2}\right )}}{\sqrt{a b} a^{4}} + \frac{3 \,{\left (7 \, a b^{2} \tan \left (f x + e\right )^{3} - 11 \, b^{3} \tan \left (f x + e\right )^{3} + 9 \, a^{2} b \tan \left (f x + e\right ) - 13 \, a b^{2} \tan \left (f x + e\right )\right )}}{{\left (b \tan \left (f x + e\right )^{2} + a\right )}^{2} a^{4}} + \frac{8 \,{\left (3 \, a \tan \left (f x + e\right )^{2} - 9 \, b \tan \left (f x + e\right )^{2} + a\right )}}{a^{4} \tan \left (f x + e\right )^{3}}}{24 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^4/(a+b*tan(f*x+e)^2)^3,x, algorithm="giac")

[Out]

-1/24*(15*(pi*floor((f*x + e)/pi + 1/2)*sgn(b) + arctan(b*tan(f*x + e)/sqrt(a*b)))*(3*a*b - 7*b^2)/(sqrt(a*b)*
a^4) + 3*(7*a*b^2*tan(f*x + e)^3 - 11*b^3*tan(f*x + e)^3 + 9*a^2*b*tan(f*x + e) - 13*a*b^2*tan(f*x + e))/((b*t
an(f*x + e)^2 + a)^2*a^4) + 8*(3*a*tan(f*x + e)^2 - 9*b*tan(f*x + e)^2 + a)/(a^4*tan(f*x + e)^3))/f